import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsNumber, IsOptional, IsString, Min } from "class-validator";

export class DeptQuery {    
    @ApiPropertyOptional({ description: '部门名称' })
    @IsOptional()
    @IsString({ message: '部门名称必须是字符串' })
    name?: string;
  
    @ApiPropertyOptional({ description: '部门编号' })
    @IsOptional()
    @IsString({ message: '部门编号必须是字符串' })
    code?: string;
  
    @ApiPropertyOptional({ description: '父节点id' })
    @IsOptional()
    @IsNumber({}, { message: '父节点ID必须是数字' })
    parent_id?: number;
  
    @ApiPropertyOptional({ description: '状态(1-正常 0-禁用)' })
    @IsOptional()
    @IsNumber({}, { message: '状态值必须是数字' })
    status?: number;
  
    @ApiPropertyOptional({ description: '页码', default: 1 })
    @IsOptional()
    page?: number = 1;
  
    @ApiPropertyOptional({ description: '每页条数', default: 10 })
    @IsOptional()
    limit?: number = 10;
  }